]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
viewSelector: notify on active page changes
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 24 Jan 2013 21:35:11 +0000 (16:35 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 14 Feb 2013 23:18:21 +0000 (18:18 -0500)
In order to do this, we also need to move the assignment of
this._activePage from the animation onComplete callback to the function
itself.

https://bugzilla.gnome.org/show_bug.cgi?id=682050

js/ui/viewSelector.js

index c925cfdae7bf78b433a2facc2c56fe5e8df2e568..e1d2ef535d0a22f704179fbfa5d9470995ab91cc 100644 (file)
@@ -201,24 +201,27 @@ const ViewSelector = new Lang.Class({
     },
 
     _showPage: function(page) {
-        if(page == this._activePage)
+        if (page == this._activePage)
             return;
 
-        if(this._activePage) {
-            Tweener.addTween(this._activePage,
+        let oldPage = this._activePage;
+        if (oldPage) {
+            Tweener.addTween(oldPage,
                              { opacity: 0,
                                time: 0.1,
                                transition: 'easeOutQuad',
                                onComplete: Lang.bind(this,
                                    function() {
-                                       this._activePage.hide();
-                                       this._activePage = page;
+                                       oldPage.hide();
                                    })
                              });
         }
 
-        page.show();
-        Tweener.addTween(page,
+        this._activePage = page;
+        this._activePage.show();
+        this.emit('page-changed');
+
+        Tweener.addTween(this._activePage,
                          { opacity: 255,
                            time: 0.1,
                            transition: 'easeOutQuad'